# 
# file: $Id: mapConfig.py 67 2009-08-28 06:01:54Z duboulay $
#
# Author: Doug du Boulay <boulay_d@chem.usyd.edu.au>
# Copyright (c) 2009, The University of Sydney
# All rights reserved.
#
# This software is distributed under the BSD license.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
#    notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
#    notice, this list of conditions and the following disclaimer in the
#    documentation and/or other materials provided with the distribution.
# 3. The name of the author may not be used to endorse or promote products
#    derived from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.


"""Here we define some dummy config parameters and hope they
   will be overridden by real ones in an other config file - 
   ostensibly  ../mapping-alt-conf/altMapConfig.py"""  

import sys
ALTCONFIGDIR = "mapping-alt-conf" 
ALTCONFIGFILE = "altMapConfig"

def importAltConfigHack():
  """Add a new config directory to the import path""" 
  import os
  pathname = os.path.dirname(sys.argv[0])        
  abspath = os.path.abspath(pathname) 
  altconfig = os.path.join(abspath,"..",ALTCONFIGDIR)  
  sys.path.append(altconfig)

# define some global system variables as dummies
DBNAME = 'fred'
DBHOST = "flinstones.gov.bedrock"
DBPORT = "1521"
DBUSER = "BARNEY"
DBSCHEMA = "WILMA."
DBPASS = "pebbles"  
ICATMETADATADIR = "icatdata"
ICATTEMPLATE = 'icatmap-dflt.xml'
#DEBUG = 1+ 2 + 4 + 8 + 16 + 32 + 64 + 128 + 256
DEBUG = 0
BYPASSDBCONN = True


# now override the above
importAltConfigHack()
try:
   from altMapConfig import *
except:
   print "No overriding config files. Using dummy settings"

